#define _CRT_SECURE_NO_WARNINGS

#include "HashTable.h"

void test_hash1()
{
	int a[] = { 19, 30, 5, 36, 13, 20, 21, 12, 24, 96, 23, 31 };
	HashTable<int, int> hash;
	for (auto& e : a)
	{
		hash.insert({ e, e });
	}
}

void test_hash2()
{
	int a[] = { 19, 30, 5, 36, 13, 20, 21, 12, 24, 96 };
	HashTable<int, int> hash;
	for (auto& e : a)
	{
		hash.insert({ e, e });
	}
	cout << hash.find(96) << endl;
	cout << hash.erase(96) << endl;
	cout << hash.find(30) << endl;
	cout << hash.erase(30) << endl;
	cout << hash.find(19) << endl;
	cout << hash.erase(19) << endl;
}

void test_hash3()
{
	HashTable<int, int> hash;
	for (int i = 1; i < 200; i++)
	{
		hash.insert({ i, i });
		if (i == 100)
		{
			cout << endl;
		}
	}
}

void test_hash4()
{
	HashTable<string, int> hash;
	hash.insert({ "one", 1 });
	hash.insert({ "two", 2 });
	hash.insert({ "five", 5 });
	cout << hash.find("five") << endl;
	cout << hash.erase("five") << endl;
	cout << hash.find("five") << endl;
}

int main()
{
	test_hash4();

	return 0;
}